home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 July
/
EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso
/
earcd
/
dev
/
amos
/
moreusel.lha
/
SamLPDemo.AMOS
/
SamLPDemo.amosSourceCode
Wrap
AMOS Source Code
|
1997-04-15
|
3KB
|
119 lines
'
' SamLongPlay Procedures V1.0
'
' Written by Christopher Hodges
'
Screen Open 0,320,200,2,0
Curs Off
Palette 0,$FFF
Dim SDAT(3,8)
Global SDAT()
'
' Hier muessen Sie Ihr Soundverzeichnis eintragen, falls Sie die
' Sounds auf Festplatte kopiert haben
'
Dir$="LibDisk4:sounds"
Print "Bitte Taste dr�cken!"
'
' Aus Platzgr�nden konnten die anderen beiden Sounds nicht mehr
' auf diese Diskette kopiert werden. Sie k�nnen hier ihre eigenen
' Samples einf�gen.
'
'SAMLP["sound6",1,15000,12748,3,16,32]
'SAMLP["sound5",1,7000,0,3,16,16]
SETSAM["sound4",1,7000,12748,16,32]
Timer=0
Print "during main-loop!"
Repeat
A$="Playing "
S=Timer/3000
If S<10 Then A$=A$+"0"
A$=A$+Mid$(Str$(S),2)+":"
S=(Timer/50) mod 60
If S<10 Then A$=A$+"0"
A$=A$+Mid$(Str$(S),2)+":"
S=(Timer mod 50)*2
If S<10 Then A$=A$+"0"
A$=A$+Mid$(Str$(S),2)+" Minutes..."
Home : Print A$
MANLP[1]
Until(Inkey$<>"") or(Mouse Key>0)
FINSAM[1]
End
Procedure SAMLP[F$,V,FREQ,LOP,QUIT,BANK,BUF]
VV=1 : If V Then For A=1 To V : Add VV,VV : Next
Erase BANK : Reserve As Chip Work BANK,BUF*1048
Open In V+1,F$
LS=Lof(V+1) : LB=BUF*512
B=0 : FL=0 : S=Start(BANK) : L=LS
Repeat
LL=Min(L,LB)
If L-LL>0 and L-LL<LB/2 Then LL=LB/2
Sload V+1 To S+B*LB,LL
If FL
Sam Swap VV To S+B*LB,LL
While Sam Swapped(V)=0
If((Inkey$<>"") and(QUIT and 1)) or((Mouse Key>0) and(QUIT and 2))
Sam Stop VV
Close V+1
Erase BANK
Pop Proc
End If
Wend
Else
Sam Raw VV,S+B*LB,LL,FREQ
FL=1
End If
B=1-B
Add L,-LL
If L=0 and LOP>-1 Then Pof(V+1)=LOP : L=LS-LOP+1
Until L=0
Fill S+B*LB To S+B*LB+LB,0
Sam Swap VV To S+B*LB,LB
While Sam Swapped(V)=0 : Wend
Sam Stop VV
Close V+1
Erase BANK
End Proc
Procedure SETSAM[F$,V,FREQ,LOP,BANK,BUF]
VV=1 : If V Then For A=1 To V : Add VV,VV : Next
SDAT(V,0)=VV
SDAT(V,1)=BANK
Erase BANK : Reserve As Chip Work BANK,BUF*1048
Open In V+1,F$
SDAT(V,2)=Lof(V+1) : SDAT(V,3)=BUF*512
SDAT(V,4)=SDAT(V,2) : SDAT(V,5)=0 : SDAT(V,6)=0
SDAT(V,7)=LOP : SDAT(V,8)=FREQ
End Proc
Procedure MANLP[V]
If Sam Swapped(V)=0 or SDAT(V,4)=0 Then Pop Proc
S=Start(SDAT(V,1))
L=SDAT(V,4) : LB=SDAT(V,3)
LL=Min(L,LB) : VV=SDAT(V,0)
If L-LL>0 and L-LL<LB/2 Then LL=LB/2
A=SDAT(V,5)*LB
Sload V+1 To S+A,LL
If SDAT(V,6)
Sam Swap VV To S+A,LL
Else
Sam Raw VV,S+A,LL,SDAT(V,8)
SDAT(V,6)=1
End If
SDAT(V,5)=1-SDAT(V,5)
Add L,-LL
If L=0 and SDAT(V,7)>-1 Then Pof(V+1)=SDAT(V,7) : L=SDAT(V,2)-SDAT(V,7)
SDAT(V,4)=L
End Proc[SDAT(V,4)]
Procedure FINSAM[V]
Sam Stop SDAT(V,0)
Close V+1
Erase SDAT(V,1)
End Proc
Procedure WAISAM[V]
S=Start(SDAT(V,1))
LB=SDAT(V,3)
A=SDAT(V,5)*LB
Fill S+A To S+A+LB,0
Sam Swap SDAT(V,0) To S+A,LB
While Sam Swapped(V)=0 : Wend
End Proc